package com.lzx.guanchajava.util;

import android.app.Activity;

/**
 * 保存MainActivity的静态单例。
 * */
public class ActivityStatic {

    private Activity mActivity;


    private ActivityStatic() {
    }

    private static ActivityStatic mInstance;
    public static ActivityStatic getInstance() {
        if (mInstance == null) {
            mInstance = new ActivityStatic();
        }
        return mInstance;
    }

    public void setActivity(Activity activity) {
        mActivity = activity;
    }

    public Activity getActivity() {
        if (mActivity != null) {
            return mActivity;
        }
        return null;
    }

    public void destroyActivity() {
        mActivity = null;
    }
}
